﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ElvesData : TimeData
{
    /// <summary>
    /// 攻击力
    /// </summary>
    public BaseData Atk { get; set; } = new BaseData();
    /// <summary>
    /// 攻击速度
    /// </summary>
    public BaseData AtkSpeed { get; set; } = new BaseData();
    /// <summary>
    /// 攻击范围
    /// </summary>
    public BaseData AtkRange { get; set; } = new BaseData();
    /// <summary>
    /// 攻击距离
    /// </summary>
    public BaseData AtkDistance { get; set; } = new BaseData();

    /// <summary>
    /// 攻击速率
    /// </summary>
    public BaseData AtkRate { get; set; } = new BaseData();

    /// <summary>
    /// 魔法值
    /// </summary>
    public BaseData Mp { get; set; } = new BaseData();

    /// <summary>
    /// 移动速度
    /// </summary>
    public BaseData WalkSpeed { get; set; } = new BaseData(600f);

    /// <summary>
    /// 奔跑速度
    /// </summary>
    public BaseData RunSpeed { get; set; } = new BaseData();


    public static ElvesData operator +(ElvesData data1, ElvesData data2)
    {
        ElvesData data = new ElvesData();

        data.Atk = data1.Atk + data2.Atk;
        data.AtkSpeed = data1.AtkSpeed + data2.AtkSpeed;
        data.AtkRange = data1.AtkRange + data2.AtkRange;
        data.AtkDistance = data1.AtkDistance + data2.AtkDistance;
        data.AtkRate = data1.AtkRate + data2.AtkRate;
        data.LocalTimeScale = data1.LocalTimeScale + data2.LocalTimeScale;
        data.Mp = data1.Mp + data2.Mp;
        data.RunSpeed = data1.RunSpeed + data2.RunSpeed;
        data.WalkSpeed = data1.WalkSpeed + data2.WalkSpeed;
        return data;
    }

    public static ElvesData operator -(ElvesData data1, ElvesData data2)
    {
        ElvesData data = new ElvesData();

        data.Atk = data1.Atk - data2.Atk;
        data.AtkSpeed = data1.AtkSpeed - data2.AtkSpeed;
        data.AtkRange = data1.AtkRange - data2.AtkRange;
        data.AtkDistance = data1.AtkDistance - data2.AtkDistance;
        data.AtkRate = data1.AtkRate - data2.AtkRate;
        data.LocalTimeScale = data1.LocalTimeScale - data2.LocalTimeScale;
        data.Mp = data1.Mp - data2.Mp;
        data.RunSpeed = data1.RunSpeed - data2.RunSpeed;
        data.WalkSpeed = data1.WalkSpeed - data2.WalkSpeed;
        return data;
    }

}
